package com.company.java.basic.day06;

public class Teat01 {
    public static void main(String[] args) {
        Square q = new Square();
        q.weight = 20;
        q.length = 30;
        System.out.println("q的面积为："+q.Area());
        System.out.println("q的周长为："+q.Perimeter());
        q.PrintSquare(q.length,q.weight,'@');

    }
}
class Square{
    int length;
    int weight;

    int Area(){
        return length*weight;
    }
    int Perimeter(){
        return (length+weight)*2;
    }
    void PrintSquare(int length, int weight, char X){
        for (int i=0;i<weight;i++){
            for (int j=0;j<length;j++){
                System.out.print(X+" ");
            }
            System.out.println();
        }
    }
}